Admin panel user list page layout

jamesperet 9 years ago
parent
commit
20e55d61da

BIN
app/assets/images/user.png


+ 1 - 1
app/assets/stylesheets/bootstrap_and_overrides.css.less

@@ -62,7 +62,7 @@
62 62
 	border-right: 1px solid #eee;
63 63
 }
64 64
 
65
-.summary a {
65
+.summary a, .summary span {
66 66
 	font-size: 1.2em;
67 67
 	line-height: 1.4em;
68 68
 	text-transform: uppercase;

+ 31 - 19
app/views/admin_panel/users.html.erb

@@ -4,24 +4,36 @@
4 4
 		<div class="page-header">
5 5
 		  <h1><%= t "admin_panel.users" %></h1>
6 6
 		</div>
7
-		<table class="table table-bordered">
8
-		  <thead>
9
-		    <tr>
10
-			 <th>Image</th>
11
-		      <th>Name</th>
12
-		      <th>Email</th>
13
-		    </tr>
14
-		  </thead>
15
-
16
-		  <tbody>
17
-		    <% @users.each do |user| %>
18
-		      <tr>
19
-			   <th><%= image_tag user.avatar.thumb.to_s if user.avatar != nil %></th>
20
-		        <td><%= user.full_name %></td>
21
-		        <td><%= user.email %></td>
22
-		      </tr>
23
-		    <% end %>
24
-		  </tbody>
25
-		</table>
7
+		<% @users.each do |user| %>
8
+			<div class="media thumbnail" style="padding: 10px; padding-bottom: 5px;">
9
+			  <span class="pull-left">
10
+			    <% if user.avatar.file != nil %>
11
+			    	  <%= image_tag user.avatar.thumb.to_s %>
12
+			    <% else %>
13
+			      <%= image_tag "user.png", size: "50x50" %>
14
+			    <% end %>
15
+			  </span>
16
+			  <div class="media-body pull-left" style="min-width: 180px;">
17
+			    <h4 class="media-heading"><%= user.full_name %></h4>
18
+			    <p><%= user.email %></p>
19
+			  </div>
20
+			  <div class="pull-left" style=" padding: 5px; padding-bottom: 0px; padding-top: 0px; margin-top: -6px; text-align: center; margin-left: 25px;">
21
+				  <span class="summary" style="margin-bottom: 0px;">
22
+				  <span class="count"><%= user.sign_in_count %></span>
23
+				  <span><%= t "admin_panel.logins" %></span></span>
24
+			  </div>
25
+			  <% if user.admin %>
26
+				  <div class="pull-left" style=" padding: 5px; padding-bottom: 0px; padding-top: 0px; margin-top: -6px; text-align: center; margin-left: 25px;">
27
+				  
28
+					  <span class="summary" style="margin-bottom: 0px;">
29
+					  <span class="count">
30
+					  
31
+						  <i class="icon-user"></i>
32
+					  </span>
33
+					  <span>Admin</span></span>
34
+				  </div>
35
+			  <% end %>
36
+			</div>
37
+		<% end %>
26 38
 	</div>
27 39
 </div>

+ 3 - 3
app/views/blog_posts/show.html.erb

@@ -1,12 +1,12 @@
1 1
 <div class="page-header">
2 2
   <h1><%= @blog_post.title %></h1>
3
-  <small>by <%= @blog_post.author.full_name %>, <%= time_ago_in_words(@blog_post.created_at) %> ago</small> 
3
+  <small><%= t "blog.by" %> <%= @blog_post.author.full_name %>, <%= time_ago_in_words(@blog_post.created_at) %> <%= t "blog.ago" %></small> 
4 4
 </div>
5 5
 
6 6
 <%= @blog_post.content.html_safe %>
7 7
 
8 8
 
9 9
 <div style="margin-top: 40px; text-align: center;">
10
-<%= link_to 'Edit', edit_blog_post_path(@blog_post), :class => 'btn btn-small' if user_signed_in? %>	
11
-<%= link_to 'Back', blog_path, :class => 'btn btn-small' %>
10
+<%= link_to (t "nav.edit"), edit_blog_post_path(@blog_post), :class => 'btn btn-small' if user_signed_in? %>	
11
+<%= link_to (t "nav.back"), blog_path, :class => 'btn btn-small' %>
12 12
 </div>

+ 5 - 5
app/views/layouts/_navigation_links.html.erb

@@ -11,15 +11,15 @@
11 11
 			</a>
12 12
 		    	<ul class="dropdown-menu">
13 13
 				<% if current_user.admin %>
14
-					<li><%= link_to 'Admin Panel', admin_dashboard_path %></li>
14
+					<li><%= link_to (t "nav.admin_panel"), admin_dashboard_path %></li>
15 15
 				<% end %>
16
-	  			<li><%= link_to 'Account', edit_user_registration_path %></li>
17
-	  			<li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li>
16
+	  			<li><%= link_to (t "nav.account"), edit_user_registration_path %></li>
17
+	  			<li><%= link_to (t "nav.logout"), destroy_user_session_path, method: :delete %></li>
18 18
 			</ul>
19 19
 		</li>
20 20
 	<% else %>
21
-		<li><%= link_to "Login", new_user_session_path  %></li>
22
-		<li><%= link_to "Sign Up", new_user_registration_path  %></li>
21
+		<li><%= link_to (t "nav.login"), new_user_session_path  %></li>
22
+		<li><%= link_to (t "nav.signup"), new_user_registration_path  %></li>
23 23
 	<% end %>
24 24
 </ul>
25 25
   

+ 14 - 1
config/locales/en.yml

@@ -209,4 +209,17 @@ en:
209 209
     posts: posts
210 210
     new_blog_post: New Post
211 211
     upload_file: Upload File
212
-    welcome: Welcome back
212
+    welcome: Welcome back
213
+    logins: Logins
214
+    last_login: Last Login
215
+  nav:
216
+    admin_panel: Admin Panel
217
+    account: Account
218
+    logout: Logout
219
+    login: Login
220
+    signup: Sign Up
221
+    back: Back
222
+    edit: Editar
223
+  blog:
224
+    by: By
225
+    ago: ago

+ 15 - 1
config/locales/pt-BR.yml

@@ -211,4 +211,18 @@ pt-BR:
211 211
     posts: Artigos
212 212
     new_blog_post: +
213 213
     upload_file: +
214
-    welcome: Bem vindo
214
+    welcome: Bem vindo
215
+    logins: Acessos
216
+    last_login: Último Acesso
217
+  nav:
218
+    admin_panel: Painel de Controle
219
+    account: Conta
220
+    logout: Sair
221
+    login: Entrar
222
+    signup: Cadastro
223
+    back: Voltar
224
+    edit: Editar
225
+  blog:
226
+    by: Por
227
+    ago: atras
228
+    

+ 8 - 2
readme.md

@@ -7,11 +7,11 @@ A template for creating rails websites that includes the following:
7 7
 * Basic Blog
8 8
 * Admin Panel
9 9
 * SummerNote editor
10
+* Image upload/File System
11
+* Translation (pt-BR, EN)
10 12
 
11 13
 Other features are still under development:
12 14
 
13
-* Image upload/File System
14
-* Translation (pt-BR, EN)
15 15
 * Email System
16 16
 * Search System
17 17
 * Wiki/Codex
@@ -23,6 +23,12 @@ Other features are still under development:
23 23
 ## Todo's
24 24
 
25 25
 * Authentication layout
26
+* post thumbnails
27
+* post form layout
28
+* edit account layout
29
+* make admin button
30
+* Install instructions
31
+* Heroku Deploy button
26 32
 
27 33
 ## Example Websites
28 34